package com.daka.vo.response.passport;

import com.daka.entity.BaseAddress;
import com.daka.entity.UserPassportApplyOrder;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * Created by yangx
 * CreateTime: 2016/10/26 11:48
 */

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class PassportResponseDetCMS {

    private Long id;                //ID
    private String name;            //姓名
    private String sex;             //性别
    private String birthday;        //出生生日
    private String passportNo;      //公益护照编号
    private int status;             //发放状态
    private Integer applyType;      //申请类型、订单类型 1 首次 2 换发 3 补发

    private String signDate;            //发证日期
    private String bassAddressName;     //基地名称
    private long bassAddressId;         //基地编号

    private String guardianName;        //监护人姓名
    private String guardianPhone;       //监护人电话
    private String guardianUnit;        //监护单位名称
    private String guardianUnitCode;    //监护单位编号

    private String contactName;         //紧急  联系人姓名
    private String contactPhone;        //联系人电话

    private String appointmenDate;      //预约时间
    private String appointmentTime;     //预约时间
    private String bassAddressAdd;         //基地

//    private String num;             //订单编号
//    private Date createTime;        //申请时间
//    private String applyTypeStr;
//    private Integer applyForm;      //申请方式： 1 在线 2 现场
//    private String applyFormStr;
//    private String cardNo;          //证件号
//    private String mobile;          //手机号


    public static PassportResponseDetCMS buildVO(UserPassportApplyOrder aa,BaseAddress baseAddress)  {
        PassportResponseDetCMS res =  new PassportResponseDetCMS();

        res.setId(aa.getId());
        res.setName(aa.getName());
        res.setSex(aa.getSex());
        res.setBirthday(aa.getBirthday());
        res.setPassportNo(aa.getPassportNo());
        res.setStatus(aa.getStatus());
        res.setApplyType(aa.getApplyType());

        res.setSignDate(aa.getSignDate());
        res.setBassAddressName(baseAddress.getName());
        res.setBassAddressId(baseAddress.getId());

        res.setGuardianName(aa.getGuardianName());
        res.setGuardianPhone(aa.getGuardianPhone());
        res.setGuardianUnit(aa.getGuardianUnit());
        res.setGuardianUnitCode(aa.getGuardianUnitCode());

        res.setContactName(aa.getContactName());
        res.setContactPhone(aa.getContactPhone());

        res.setAppointmenDate(aa.getAppointmenDate());
        res.setAppointmentTime(aa.getAppointmentTime());
        res.setBassAddressAdd(baseAddress.getAddress());
        return res;
    }

}
